home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / AIncludes / Menus.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  34.0 KB  |  1,184 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Menus.a
  3. ;
  4. ;    Contains:    Menu Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8.5
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  18. __MENUS__ SET 1
  19.  
  20.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  21.     include 'AppleEvents.a'
  22.     ENDIF
  23.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  24.     include 'ConditionalMacros.a'
  25.     ENDIF
  26.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  27.     include 'Events.a'
  28.     ENDIF
  29.     IF &TYPE('__PROCESSES__') = 'UNDEFINED' THEN
  30.     include 'Processes.a'
  31.     ENDIF
  32.     IF &TYPE('__TEXTCOMMON__') = 'UNDEFINED' THEN
  33.     include 'TextCommon.a'
  34.     ENDIF
  35.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  36.     include 'MacTypes.a'
  37.     ENDIF
  38.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  39.     include 'Quickdraw.a'
  40.     ENDIF
  41.  
  42. ; ——————————————————————————————————————————————————————————————————————————————————————
  43. ;     • Gestalt and Errors (Mac OS 8.5 and later)                                            
  44. ; ——————————————————————————————————————————————————————————————————————————————————————
  45.  
  46. gestaltMenuMgrAttr                EQU        'menu'                ; If this Gestalt exists, the Mac OS 8.5 Menu Manager is installed
  47. gestaltMenuMgrPresent            EQU        1
  48.  
  49. menuPropertyInvalid                EQU        -5603
  50. menuPropertyNotFoundErr            EQU        -5604
  51.  
  52. ; ——————————————————————————————————————————————————————————————————————————————————————
  53. ;     • Menu Constants                                                                     
  54. ; ——————————————————————————————————————————————————————————————————————————————————————
  55.  
  56. noMark                            EQU        0                    ;mark symbol for MarkItem
  57.  
  58.                                                             ; menu defProc messages 
  59. kMenuDrawMsg                    EQU        0
  60. kMenuChooseMsg                    EQU        1
  61. kMenuSizeMsg                    EQU        2
  62. kMenuDrawItemMsg                EQU        4
  63. kMenuCalcItemMsg                EQU        5
  64. kMenuThemeSavvyMsg                EQU        7                    ; is your MDEF theme-savvy?  If so, return hex 7473 in the whichItem parameter
  65. mDrawMsg                        EQU        0
  66. mChooseMsg                        EQU        1
  67. mSizeMsg                        EQU        2
  68. mDrawItemMsg                    EQU        4
  69. mCalcItemMsg                    EQU        5
  70.  
  71. kThemeSavvyMenuResponse            EQU        $7473
  72.  
  73. textMenuProc                    EQU        0
  74. hMenuCmd                        EQU        27                    ;itemCmd == 0x001B ==> hierarchical menu
  75. hierMenu                        EQU        -1                    ;a hierarchical menu - for InsertMenu call
  76. mPopUpMsg                        EQU        3                    ;menu defProc messages - place yourself
  77. mctAllItems                        EQU        -98                    ;search for all Items for the given ID
  78. mctLastIDIndic                    EQU        -99                    ;last color table entry has this in ID field
  79. ;  Constants for use with MacOS 8.0 (Appearance 1.0) and later
  80.  
  81. kMenuStdMenuProc                EQU        63
  82. kMenuStdMenuBarProc                EQU        63
  83.  
  84. kMenuNoModifiers                EQU        0                    ; Mask for no modifiers
  85. kMenuShiftModifier                EQU        $01                    ; Mask for shift key modifier
  86. kMenuOptionModifier                EQU        $02                    ; Mask for option key modifier
  87. kMenuControlModifier            EQU        $04                    ; Mask for control key modifier
  88. kMenuNoCommandModifier            EQU        $08                    ; Mask for no command key modifier
  89.  
  90. kMenuNoIcon                        EQU        0                    ; No icon
  91. kMenuIconType                    EQU        1                    ; Type for ICON
  92. kMenuShrinkIconType                EQU        2                    ; Type for ICON plotted 16 x 16
  93. kMenuSmallIconType                EQU        3                    ; Type for SICN
  94. kMenuColorIconType                EQU        4                    ; Type for cicn
  95. kMenuIconSuiteType                EQU        5                    ; Type for Icon Suite
  96. kMenuIconRefType                EQU        6                    ; Type for Icon Ref
  97.  
  98.  
  99. ; ——————————————————————————————————————————————————————————————————————————————————————
  100. ;     • Menu Structures                                                                     
  101. ; ——————————————————————————————————————————————————————————————————————————————————————
  102. MenuInfo                RECORD 0
  103. menuID                     ds.w    1                ; offset: $0 (0)
  104. menuWidth                 ds.w    1                ; offset: $2 (2)
  105. menuHeight                 ds.w    1                ; offset: $4 (4)
  106. menuProc                 ds.l    1                ; offset: $6 (6)
  107. enableFlags                 ds.l    1                ; offset: $A (10)
  108. menuData                 ds        Str255            ; offset: $E (14)
  109. sizeof                     EQU *                    ; size:   $10E (270)
  110.                         ENDR
  111. ; typedef struct MenuInfo *                MenuPtr
  112.  
  113. ; typedef MenuPtr *                        MenuHandle
  114.  
  115. ;  MenuRef is obsolete.  Use MenuHandle.  Or don’t.  It’s all the same to us.  We’re here to serve.
  116. ; typedef MenuHandle                     MenuRef
  117.  
  118. MCEntry                    RECORD 0
  119. mctID                     ds.w    1                ; offset: $0 (0)        ; menu ID.  ID = 0 is the menu bar
  120. mctItem                     ds.w    1                ; offset: $2 (2)        ; menu Item. Item = 0 is a title
  121. mctRGB1                     ds        RGBColor        ; offset: $4 (4)        ; usage depends on ID and Item
  122. mctRGB2                     ds        RGBColor        ; offset: $A (10)        ; usage depends on ID and Item
  123. mctRGB3                     ds        RGBColor        ; offset: $10 (16)        ; usage depends on ID and Item
  124. mctRGB4                     ds        RGBColor        ; offset: $16 (22)        ; usage depends on ID and Item
  125. mctReserved                 ds.w    1                ; offset: $1C (28)        ; reserved for internal use
  126. sizeof                     EQU *                    ; size:   $1E (30)
  127.                         ENDR
  128. ; typedef struct MCEntry *                MCEntryPtr
  129.  
  130. MCTable                    RECORD 0
  131. elements                 ds.b    1 * MCEntry.sizeof
  132. sizeof                     EQU *                    ; size:   $1E (30)
  133.                         ENDR
  134.  
  135.  
  136. ; typedef struct MCEntry *                MCTablePtr
  137.  
  138. ; typedef MCTablePtr *                    MCTableHandle
  139.  
  140. MenuCRsrc                RECORD 0
  141. numEntries                 ds.w    1                ; offset: $0 (0)        ; number of entries
  142. mcEntryRecs                 ds        MCTable            ; offset: $2 (2)        ; ARRAY [1..numEntries] of MCEntry
  143. sizeof                     EQU *                    ; size:   $20 (32)
  144.                         ENDR
  145. ; typedef struct MenuCRsrc *            MenuCRsrcPtr
  146.  
  147. ; typedef MenuCRsrcPtr *                MenuCRsrcHandle
  148.  
  149.     IF TARGET_OS_WIN32 THEN
  150. ;  QuickTime 3.0 
  151. MenuAccessKeyRec        RECORD 0
  152. count                     ds.w    1                ; offset: $0 (0)
  153. flags                     ds.l    1                ; offset: $2 (2)
  154. keys                     ds.b    1                ; offset: $6 (6) <-- really an array of length one
  155.                          ORG 8
  156. sizeof                     EQU *                    ; size:   $8 (8)
  157.                         ENDR
  158. ; typedef struct MenuAccessKeyRec *        MenuAccessKeyPtr
  159.  
  160. ; typedef MenuAccessKeyPtr *            MenuAccessKeyHandle
  161.  
  162. ;
  163. ; extern void SetMenuItemHotKey(MenuHandle menu, short itemID, char hotKey, long flags)
  164. ;
  165.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  166.         IMPORT_CFM_FUNCTION SetMenuItemHotKey
  167.     ENDIF
  168.  
  169.     ENDIF    ; TARGET_OS_WIN32
  170. ; ——————————————————————————————————————————————————————————————————————————————————————
  171. ;     • Menu ProcPtrs                                                                     
  172. ;                                                                                         
  173. ;     All of these procs are considered deprecated.  Developers interested in portability    
  174. ;     to Carbon should avoid them entirely, if at all possible.                            
  175. ; ——————————————————————————————————————————————————————————————————————————————————————
  176. ; ——————————————————————————————————————————————————————————————————————————————————————
  177. ;     • Menu Manager Initialization                                                        
  178. ; ——————————————————————————————————————————————————————————————————————————————————————
  179. ;
  180. ; pascal void InitProcMenu(short resID)
  181. ;
  182.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  183.         _InitProcMenu:    OPWORD    $A808
  184.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  185.         IMPORT_CFM_FUNCTION InitProcMenu
  186.     ENDIF
  187.  
  188. ;
  189. ; pascal void InitMenus(void )
  190. ;
  191.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  192.         _InitMenus:    OPWORD    $A930
  193.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  194.         IMPORT_CFM_FUNCTION InitMenus
  195.     ENDIF
  196.  
  197. ; ——————————————————————————————————————————————————————————————————————————————————————
  198. ;     • Menu Manipulation                                                                     
  199. ; ——————————————————————————————————————————————————————————————————————————————————————
  200. ;
  201. ; pascal MenuHandle NewMenu(short menuID, ConstStr255Param menuTitle)
  202. ;
  203.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  204.         _NewMenu:    OPWORD    $A931
  205.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  206.         IMPORT_CFM_FUNCTION NewMenu
  207.     ENDIF
  208.  
  209. ;
  210. ; pascal MenuHandle GetMenu(short resourceID)
  211. ;
  212.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  213.         _GetMenu:    OPWORD    $A9BF
  214.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  215.         IMPORT_CFM_FUNCTION GetMenu
  216.     ENDIF
  217.  
  218. ;
  219. ; pascal void DisposeMenu(MenuHandle theMenu)
  220. ;
  221.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  222.         _DisposeMenu:    OPWORD    $A932
  223.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  224.         IMPORT_CFM_FUNCTION DisposeMenu
  225.     ENDIF
  226.  
  227. ;
  228. ; pascal void CalcMenuSize(MenuHandle theMenu)
  229. ;
  230.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  231.         _CalcMenuSize:    OPWORD    $A948
  232.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  233.         IMPORT_CFM_FUNCTION CalcMenuSize
  234.     ENDIF
  235.  
  236. ;
  237. ; pascal short CountMItems(MenuHandle theMenu)
  238. ;
  239.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  240.         _CountMItems:    OPWORD    $A950
  241.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  242.         IMPORT_CFM_FUNCTION CountMItems
  243.     ENDIF
  244.  
  245. ;  Routines available in Mac OS 8.5 and later
  246.  
  247. ;
  248. ; pascal OSStatus GetMenuFont(MenuHandle menu, SInt16 *outFontID, UInt16 *outFontSize)
  249. ;
  250.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  251.         IMPORT_CFM_FUNCTION GetMenuFont
  252.     ENDIF
  253.  
  254. ;
  255. ; pascal OSStatus SetMenuFont(MenuHandle menu, SInt16 inFontID, UInt16 inFontSize)
  256. ;
  257.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  258.         IMPORT_CFM_FUNCTION SetMenuFont
  259.     ENDIF
  260.  
  261. ;
  262. ; pascal Boolean GetMenuExcludesMarkColumn(MenuHandle menu)
  263. ;
  264.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  265.         IMPORT_CFM_FUNCTION GetMenuExcludesMarkColumn
  266.     ENDIF
  267.  
  268. ;
  269. ; pascal OSStatus SetMenuExcludesMarkColumn(MenuHandle menu, Boolean excludesMark)
  270. ;
  271.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  272.         IMPORT_CFM_FUNCTION SetMenuExcludesMarkColumn
  273.     ENDIF
  274.  
  275. ; ——————————————————————————————————————————————————————————————————————————————————————
  276. ;     • Menu Item Insertion                                                                 
  277. ; ——————————————————————————————————————————————————————————————————————————————————————
  278. ;
  279. ; pascal void AppendMenu(MenuHandle menu, ConstStr255Param data)
  280. ;
  281.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  282.         _AppendMenu:    OPWORD    $A933
  283.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  284.         IMPORT_CFM_FUNCTION AppendMenu
  285.     ENDIF
  286.  
  287. ;
  288. ; pascal void InsertResMenu(MenuHandle theMenu, ResType theType, short afterItem)
  289. ;
  290.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  291.         _InsertResMenu:    OPWORD    $A951
  292.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  293.         IMPORT_CFM_FUNCTION InsertResMenu
  294.     ENDIF
  295.  
  296. ;
  297. ; pascal void AppendResMenu(MenuHandle theMenu, ResType theType)
  298. ;
  299.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  300.         _AppendResMenu:    OPWORD    $A94D
  301.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  302.         IMPORT_CFM_FUNCTION AppendResMenu
  303.     ENDIF
  304.  
  305. ;
  306. ; pascal void InsertMenuItem(MenuHandle theMenu, ConstStr255Param itemString, short afterItem)
  307. ;
  308.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  309.         _InsertMenuItem:    OPWORD    $A826
  310.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  311.         IMPORT_CFM_FUNCTION InsertMenuItem
  312.     ENDIF
  313.  
  314. ;
  315. ; pascal void DeleteMenuItem(MenuHandle theMenu, short item)
  316. ;
  317.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  318.         _DeleteMenuItem:    OPWORD    $A952
  319.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  320.         IMPORT_CFM_FUNCTION DeleteMenuItem
  321.     ENDIF
  322.  
  323. ;
  324. ; pascal void InsertFontResMenu(MenuHandle theMenu, short afterItem, short scriptFilter)
  325. ;
  326.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  327.         Macro
  328.         _InsertFontResMenu
  329.             move.w              #$0400,D0
  330.             dc.w                $A825
  331.         EndM
  332.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  333.         IMPORT_CFM_FUNCTION InsertFontResMenu
  334.     ENDIF
  335.  
  336. ;
  337. ; pascal void InsertIntlResMenu(MenuHandle theMenu, ResType theType, short afterItem, short scriptFilter)
  338. ;
  339.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  340.         Macro
  341.         _InsertIntlResMenu
  342.             move.w              #$0601,D0
  343.             dc.w                $A825
  344.         EndM
  345.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  346.         IMPORT_CFM_FUNCTION InsertIntlResMenu
  347.     ENDIF
  348.  
  349. ;  Routines available in Mac OS 8.5 and later
  350.  
  351. ;
  352. ; pascal OSStatus AppendMenuItemText(MenuHandle menu, ConstStr255Param inString)
  353. ;
  354.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  355.         IMPORT_CFM_FUNCTION AppendMenuItemText
  356.     ENDIF
  357.  
  358. ;
  359. ; pascal OSStatus InsertMenuItemText(MenuHandle menu, ConstStr255Param inString, UInt16 afterItem)
  360. ;
  361.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  362.         IMPORT_CFM_FUNCTION InsertMenuItemText
  363.     ENDIF
  364.  
  365. ; ——————————————————————————————————————————————————————————————————————————————————————
  366. ;     • Menu Events                                                                         
  367. ; ——————————————————————————————————————————————————————————————————————————————————————
  368. ;
  369. ; pascal long MenuKey(CharParameter ch)
  370. ;
  371.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  372.         _MenuKey:    OPWORD    $A93E
  373.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  374.         IMPORT_CFM_FUNCTION MenuKey
  375.     ENDIF
  376.  
  377. ;
  378. ; pascal long MenuSelect(Point startPt)
  379. ;
  380.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  381.         _MenuSelect:    OPWORD    $A93D
  382.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  383.         IMPORT_CFM_FUNCTION MenuSelect
  384.     ENDIF
  385.  
  386. ;
  387. ; pascal long PopUpMenuSelect(MenuHandle menu, short top, short left, short popUpItem)
  388. ;
  389.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  390.         _PopUpMenuSelect:    OPWORD    $A80B
  391.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  392.         IMPORT_CFM_FUNCTION PopUpMenuSelect
  393.     ENDIF
  394.  
  395. ;
  396. ; pascal long MenuChoice(void )
  397. ;
  398.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  399.         _MenuChoice:    OPWORD    $AA66
  400.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  401.         IMPORT_CFM_FUNCTION MenuChoice
  402.     ENDIF
  403.  
  404. ;  Routines available in Mac OS 8.0 (Appearance 1.0) and later
  405. ;
  406. ; pascal UInt32 MenuEvent(const EventRecord *inEvent)
  407. ;
  408.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  409.         Macro
  410.         _MenuEvent
  411.             move.w              #$020C,D0
  412.             dc.w                $A825
  413.         EndM
  414.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  415.         IMPORT_CFM_FUNCTION MenuEvent
  416.     ENDIF
  417.  
  418.  
  419. ; ——————————————————————————————————————————————————————————————————————————————————————
  420. ;     • Menu Bar                                                                               
  421. ; ——————————————————————————————————————————————————————————————————————————————————————
  422. ;
  423. ; pascal short GetMBarHeight(void)
  424. ;
  425.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  426.         Macro
  427.         _GetMBarHeight        &dest=(sp)
  428.             move.w            $0BAA,&dest
  429.         EndM
  430.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  431.         IMPORT_CFM_FUNCTION GetMBarHeight
  432.     ENDIF
  433.  
  434. ;
  435. ; pascal void DrawMenuBar(void )
  436. ;
  437.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  438.         _DrawMenuBar:    OPWORD    $A937
  439.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  440.         IMPORT_CFM_FUNCTION DrawMenuBar
  441.     ENDIF
  442.  
  443. ;
  444. ; pascal void InvalMenuBar(void )
  445. ;
  446.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  447.         _InvalMenuBar:    OPWORD    $A81D
  448.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  449.         IMPORT_CFM_FUNCTION InvalMenuBar
  450.     ENDIF
  451.  
  452. ;
  453. ; pascal void HiliteMenu(short menuID)
  454. ;
  455.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  456.         _HiliteMenu:    OPWORD    $A938
  457.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  458.         IMPORT_CFM_FUNCTION HiliteMenu
  459.     ENDIF
  460.  
  461. ;
  462. ; pascal Handle GetNewMBar(short menuBarID)
  463. ;
  464.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  465.         _GetNewMBar:    OPWORD    $A9C0
  466.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  467.         IMPORT_CFM_FUNCTION GetNewMBar
  468.     ENDIF
  469.  
  470. ;
  471. ; pascal Handle GetMenuBar(void )
  472. ;
  473.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  474.         _GetMenuBar:    OPWORD    $A93B
  475.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  476.         IMPORT_CFM_FUNCTION GetMenuBar
  477.     ENDIF
  478.  
  479. ;
  480. ; pascal void SetMenuBar(Handle menuList)
  481. ;
  482.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  483.         _SetMenuBar:    OPWORD    $A93C
  484.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  485.         IMPORT_CFM_FUNCTION SetMenuBar
  486.     ENDIF
  487.  
  488. ;
  489. ; pascal MenuHandle GetMenuHandle(short menuID)
  490. ;
  491.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  492.         _GetMenuHandle:    OPWORD    $A949
  493.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  494.         IMPORT_CFM_FUNCTION GetMenuHandle
  495.     ENDIF
  496.  
  497. ;
  498. ; pascal void InsertMenu(MenuHandle theMenu, short beforeID)
  499. ;
  500.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  501.         _InsertMenu:    OPWORD    $A935
  502.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  503.         IMPORT_CFM_FUNCTION InsertMenu
  504.     ENDIF
  505.  
  506. ;
  507. ; pascal void DeleteMenu(short menuID)
  508. ;
  509.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  510.         _DeleteMenu:    OPWORD    $A936
  511.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  512.         IMPORT_CFM_FUNCTION DeleteMenu
  513.     ENDIF
  514.  
  515. ;
  516. ; pascal void ClearMenuBar(void )
  517. ;
  518.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  519.         _ClearMenuBar:    OPWORD    $A934
  520.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  521.         IMPORT_CFM_FUNCTION ClearMenuBar
  522.     ENDIF
  523.  
  524. ;
  525. ; pascal void SetMenuFlash(short count)
  526. ;
  527.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  528.         _SetMenuFlash:    OPWORD    $A94A
  529.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  530.         IMPORT_CFM_FUNCTION SetMenuFlash
  531.     ENDIF
  532.  
  533. ;
  534. ; pascal void FlashMenuBar(short menuID)
  535. ;
  536.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  537.         _FlashMenuBar:    OPWORD    $A94C
  538.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  539.         IMPORT_CFM_FUNCTION FlashMenuBar
  540.     ENDIF
  541.  
  542. ;
  543. ; pascal Boolean SystemEdit(short editCmd)
  544. ;
  545.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  546.         _SystemEdit:    OPWORD    $A9C2
  547.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  548.         IMPORT_CFM_FUNCTION SystemEdit
  549.     ENDIF
  550.  
  551. ;
  552. ; pascal void SystemMenu(long menuResult)
  553. ;
  554.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  555.         _SystemMenu:    OPWORD    $A9B5
  556.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  557.         IMPORT_CFM_FUNCTION SystemMenu
  558.     ENDIF
  559.  
  560. ;  Routines available in Mac OS 8.5 and later
  561. ;
  562. ; pascal Boolean IsMenuBarVisible(void )
  563. ;
  564.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  565.         IMPORT_CFM_FUNCTION IsMenuBarVisible
  566.     ENDIF
  567.  
  568. ;
  569. ; pascal void ShowMenuBar(void )
  570. ;
  571.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  572.         IMPORT_CFM_FUNCTION ShowMenuBar
  573.     ENDIF
  574.  
  575. ;
  576. ; pascal void HideMenuBar(void )
  577. ;
  578.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  579.         IMPORT_CFM_FUNCTION HideMenuBar
  580.     ENDIF
  581.  
  582.  
  583. ; ——————————————————————————————————————————————————————————————————————————————————————
  584. ;     • Menu Item Accessors                                                                 
  585. ; ——————————————————————————————————————————————————————————————————————————————————————
  586. ;
  587. ; pascal void CheckItem(MenuHandle theMenu, short item, Boolean checked)
  588. ;
  589.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  590.         _CheckItem:    OPWORD    $A945
  591.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  592.         IMPORT_CFM_FUNCTION CheckItem
  593.     ENDIF
  594.  
  595. ;
  596. ; pascal void SetMenuItemText(MenuHandle theMenu, short item, ConstStr255Param itemString)
  597. ;
  598.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  599.         _SetMenuItemText:    OPWORD    $A947
  600.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  601.         IMPORT_CFM_FUNCTION SetMenuItemText
  602.     ENDIF
  603.  
  604. ;
  605. ; pascal void GetMenuItemText(MenuHandle theMenu, short item, Str255 itemString)
  606. ;
  607.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  608.         _GetMenuItemText:    OPWORD    $A946
  609.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  610.         IMPORT_CFM_FUNCTION GetMenuItemText
  611.     ENDIF
  612.  
  613. ;
  614. ; pascal void SetItemMark(MenuHandle theMenu, short item, CharParameter markChar)
  615. ;
  616.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  617.         _SetItemMark:    OPWORD    $A944
  618.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  619.         IMPORT_CFM_FUNCTION SetItemMark
  620.     ENDIF
  621.  
  622. ;
  623. ; pascal void GetItemMark(MenuHandle theMenu, short item, CharParameter *markChar)
  624. ;
  625.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  626.         _GetItemMark:    OPWORD    $A943
  627.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  628.         IMPORT_CFM_FUNCTION GetItemMark
  629.     ENDIF
  630.  
  631. ;
  632. ; pascal void SetItemCmd(MenuHandle theMenu, short item, CharParameter cmdChar)
  633. ;
  634.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  635.         _SetItemCmd:    OPWORD    $A84F
  636.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  637.         IMPORT_CFM_FUNCTION SetItemCmd
  638.     ENDIF
  639.  
  640. ;
  641. ; pascal void GetItemCmd(MenuHandle theMenu, short item, CharParameter *cmdChar)
  642. ;
  643.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  644.         _GetItemCmd:    OPWORD    $A84E
  645.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  646.         IMPORT_CFM_FUNCTION GetItemCmd
  647.     ENDIF
  648.  
  649. ;
  650. ; pascal void SetItemIcon(MenuHandle theMenu, short item, short iconIndex)
  651. ;
  652.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  653.         _SetItemIcon:    OPWORD    $A940
  654.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  655.         IMPORT_CFM_FUNCTION SetItemIcon
  656.     ENDIF
  657.  
  658. ;
  659. ; pascal void GetItemIcon(MenuHandle theMenu, short item, short *iconIndex)
  660. ;
  661.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  662.         _GetItemIcon:    OPWORD    $A93F
  663.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  664.         IMPORT_CFM_FUNCTION GetItemIcon
  665.     ENDIF
  666.  
  667. ;
  668. ; pascal void SetItemStyle(MenuHandle theMenu, short item, StyleParameter chStyle)
  669. ;
  670.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  671.         _SetItemStyle:    OPWORD    $A942
  672.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  673.         IMPORT_CFM_FUNCTION SetItemStyle
  674.     ENDIF
  675.  
  676. ;
  677. ; pascal void GetItemStyle(MenuHandle theMenu, short item, Style *chStyle)
  678. ;
  679.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  680.         _GetItemStyle:    OPWORD    $A941
  681.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  682.         IMPORT_CFM_FUNCTION GetItemStyle
  683.     ENDIF
  684.  
  685. ;
  686. ; pascal void DisableItem(MenuHandle theMenu, short item)
  687. ;
  688.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  689.         _DisableItem:    OPWORD    $A93A
  690.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  691.         IMPORT_CFM_FUNCTION DisableItem
  692.     ENDIF
  693.  
  694. ;
  695. ; pascal void EnableItem(MenuHandle theMenu, short item)
  696. ;
  697.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  698.         _EnableItem:    OPWORD    $A939
  699.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  700.         IMPORT_CFM_FUNCTION EnableItem
  701.     ENDIF
  702.  
  703. ;  Routines available in Mac OS 8.0 (Appearance 1.0) and later
  704.  
  705. ;
  706. ; pascal OSErr SetMenuItemCommandID(MenuHandle inMenu, SInt16 inItem, UInt32 inCommandID)
  707. ;
  708.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  709.         Macro
  710.         _SetMenuItemCommandID
  711.             move.w              #$0502,D0
  712.             dc.w                $A825
  713.         EndM
  714.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  715.         IMPORT_CFM_FUNCTION SetMenuItemCommandID
  716.     ENDIF
  717.  
  718. ;
  719. ; pascal OSErr GetMenuItemCommandID(MenuHandle inMenu, SInt16 inItem, UInt32 *outCommandID)
  720. ;
  721.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  722.         Macro
  723.         _GetMenuItemCommandID
  724.             move.w              #$0503,D0
  725.             dc.w                $A825
  726.         EndM
  727.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  728.         IMPORT_CFM_FUNCTION GetMenuItemCommandID
  729.     ENDIF
  730.  
  731. ;
  732. ; pascal OSErr SetMenuItemModifiers(MenuHandle inMenu, SInt16 inItem, UInt8 inModifiers)
  733. ;
  734.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  735.         Macro
  736.         _SetMenuItemModifiers
  737.             move.w              #$0404,D0
  738.             dc.w                $A825
  739.         EndM
  740.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  741.         IMPORT_CFM_FUNCTION SetMenuItemModifiers
  742.     ENDIF
  743.  
  744. ;
  745. ; pascal OSErr GetMenuItemModifiers(MenuHandle inMenu, SInt16 inItem, UInt8 *outModifiers)
  746. ;
  747.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  748.         Macro
  749.         _GetMenuItemModifiers
  750.             move.w              #$0505,D0
  751.             dc.w                $A825
  752.         EndM
  753.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  754.         IMPORT_CFM_FUNCTION GetMenuItemModifiers
  755.     ENDIF
  756.  
  757. ;
  758. ; pascal OSErr SetMenuItemIconHandle(MenuHandle inMenu, SInt16 inItem, UInt8 inIconType, Handle inIconHandle)
  759. ;
  760.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  761.         Macro
  762.         _SetMenuItemIconHandle
  763.             move.w              #$0606,D0
  764.             dc.w                $A825
  765.         EndM
  766.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  767.         IMPORT_CFM_FUNCTION SetMenuItemIconHandle
  768.     ENDIF
  769.  
  770. ;
  771. ; pascal OSErr GetMenuItemIconHandle(MenuHandle inMenu, SInt16 inItem, UInt8 *outIconType, Handle *outIconHandle)
  772. ;
  773.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  774.         Macro
  775.         _GetMenuItemIconHandle
  776.             move.w              #$0707,D0
  777.             dc.w                $A825
  778.         EndM
  779.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  780.         IMPORT_CFM_FUNCTION GetMenuItemIconHandle
  781.     ENDIF
  782.  
  783. ;
  784. ; pascal OSErr SetMenuItemTextEncoding(MenuHandle inMenu, SInt16 inItem, TextEncoding inScriptID)
  785. ;
  786.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  787.         Macro
  788.         _SetMenuItemTextEncoding
  789.             move.w              #$0408,D0
  790.             dc.w                $A825
  791.         EndM
  792.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  793.         IMPORT_CFM_FUNCTION SetMenuItemTextEncoding
  794.     ENDIF
  795.  
  796. ;
  797. ; pascal OSErr GetMenuItemTextEncoding(MenuHandle inMenu, SInt16 inItem, TextEncoding *outScriptID)
  798. ;
  799.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  800.         Macro
  801.         _GetMenuItemTextEncoding
  802.             move.w              #$0509,D0
  803.             dc.w                $A825
  804.         EndM
  805.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  806.         IMPORT_CFM_FUNCTION GetMenuItemTextEncoding
  807.     ENDIF
  808.  
  809. ;
  810. ; pascal OSErr SetMenuItemHierarchicalID(MenuHandle inMenu, SInt16 inItem, SInt16 inHierID)
  811. ;
  812.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  813.         Macro
  814.         _SetMenuItemHierarchicalID
  815.             move.w              #$040D,D0
  816.             dc.w                $A825
  817.         EndM
  818.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  819.         IMPORT_CFM_FUNCTION SetMenuItemHierarchicalID
  820.     ENDIF
  821.  
  822. ;
  823. ; pascal OSErr GetMenuItemHierarchicalID(MenuHandle inMenu, SInt16 inItem, SInt16 *outHierID)
  824. ;
  825.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  826.         Macro
  827.         _GetMenuItemHierarchicalID
  828.             move.w              #$050E,D0
  829.             dc.w                $A825
  830.         EndM
  831.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  832.         IMPORT_CFM_FUNCTION GetMenuItemHierarchicalID
  833.     ENDIF
  834.  
  835. ;
  836. ; pascal OSErr SetMenuItemFontID(MenuHandle inMenu, SInt16 inItem, SInt16 inFontID)
  837. ;
  838.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  839.         Macro
  840.         _SetMenuItemFontID
  841.             move.w              #$040F,D0
  842.             dc.w                $A825
  843.         EndM
  844.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  845.         IMPORT_CFM_FUNCTION SetMenuItemFontID
  846.     ENDIF
  847.  
  848. ;
  849. ; pascal OSErr GetMenuItemFontID(MenuHandle inMenu, SInt16 inItem, SInt16 *outFontID)
  850. ;
  851.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  852.         Macro
  853.         _GetMenuItemFontID
  854.             move.w              #$0510,D0
  855.             dc.w                $A825
  856.         EndM
  857.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  858.         IMPORT_CFM_FUNCTION GetMenuItemFontID
  859.     ENDIF
  860.  
  861. ;
  862. ; pascal OSErr SetMenuItemRefCon(MenuHandle inMenu, SInt16 inItem, UInt32 inRefCon)
  863. ;
  864.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  865.         Macro
  866.         _SetMenuItemRefCon
  867.             move.w              #$050A,D0
  868.             dc.w                $A825
  869.         EndM
  870.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  871.         IMPORT_CFM_FUNCTION SetMenuItemRefCon
  872.     ENDIF
  873.  
  874. ;
  875. ; pascal OSErr GetMenuItemRefCon(MenuHandle inMenu, SInt16 inItem, UInt32 *outRefCon)
  876. ;
  877.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  878.         Macro
  879.         _GetMenuItemRefCon
  880.             move.w              #$050B,D0
  881.             dc.w                $A825
  882.         EndM
  883.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  884.         IMPORT_CFM_FUNCTION GetMenuItemRefCon
  885.     ENDIF
  886.  
  887. ;
  888. ; pascal OSErr SetMenuItemRefCon2(MenuHandle inMenu, SInt16 inItem, UInt32 inRefCon2)
  889. ;
  890.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  891.         Macro
  892.         _SetMenuItemRefCon2
  893.             move.w              #$0511,D0
  894.             dc.w                $A825
  895.         EndM
  896.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  897.         IMPORT_CFM_FUNCTION SetMenuItemRefCon2
  898.     ENDIF
  899.  
  900. ;
  901. ; pascal OSErr GetMenuItemRefCon2(MenuHandle inMenu, SInt16 inItem, UInt32 *outRefCon2)
  902. ;
  903.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  904.         Macro
  905.         _GetMenuItemRefCon2
  906.             move.w              #$0512,D0
  907.             dc.w                $A825
  908.         EndM
  909.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  910.         IMPORT_CFM_FUNCTION GetMenuItemRefCon2
  911.     ENDIF
  912.  
  913. ;
  914. ; pascal OSErr SetMenuItemKeyGlyph(MenuHandle inMenu, SInt16 inItem, SInt16 inGlyph)
  915. ;
  916.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  917.         Macro
  918.         _SetMenuItemKeyGlyph
  919.             move.w              #$0513,D0
  920.             dc.w                $A825
  921.         EndM
  922.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  923.         IMPORT_CFM_FUNCTION SetMenuItemKeyGlyph
  924.     ENDIF
  925.  
  926. ;
  927. ; pascal OSErr GetMenuItemKeyGlyph(MenuHandle inMenu, SInt16 inItem, SInt16 *outGlyph)
  928. ;
  929.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  930.         Macro
  931.         _GetMenuItemKeyGlyph
  932.             move.w              #$0514,D0
  933.             dc.w                $A825
  934.         EndM
  935.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  936.         IMPORT_CFM_FUNCTION GetMenuItemKeyGlyph
  937.     ENDIF
  938.  
  939. ;  Routines available in Mac OS 8.5 and later (supporting enabling/disabling of > 31 items)
  940.  
  941. ;
  942. ; pascal void EnableMenuItem(MenuHandle theMenu, UInt16 item)
  943. ;
  944.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  945.         IMPORT_CFM_FUNCTION EnableMenuItem
  946.     ENDIF
  947.  
  948. ;
  949. ; pascal void DisableMenuItem(MenuHandle theMenu, UInt16 item)
  950. ;
  951.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  952.         IMPORT_CFM_FUNCTION DisableMenuItem
  953.     ENDIF
  954.  
  955. ;
  956. ; pascal Boolean IsMenuItemEnabled(MenuHandle menu, UInt16 item)
  957. ;
  958.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  959.         IMPORT_CFM_FUNCTION IsMenuItemEnabled
  960.     ENDIF
  961.  
  962. ;
  963. ; pascal void EnableMenuItemIcon(MenuHandle theMenu, UInt16 item)
  964. ;
  965.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  966.         Macro
  967.         _EnableMenuItemIcon
  968.             move.w              #$0019,D0
  969.             dc.w                $A825
  970.         EndM
  971.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  972.         IMPORT_CFM_FUNCTION EnableMenuItemIcon
  973.     ENDIF
  974.  
  975. ;
  976. ; pascal void DisableMenuItemIcon(MenuHandle theMenu, UInt16 item)
  977. ;
  978.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  979.         Macro
  980.         _DisableMenuItemIcon
  981.             move.w              #$0020,D0
  982.             dc.w                $A825
  983.         EndM
  984.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  985.         IMPORT_CFM_FUNCTION DisableMenuItemIcon
  986.     ENDIF
  987.  
  988. ;
  989. ; pascal Boolean IsMenuItemIconEnabled(MenuHandle menu, UInt16 item)
  990. ;
  991.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  992.         Macro
  993.         _IsMenuItemIconEnabled
  994.             move.w              #$0018,D0
  995.             dc.w                $A825
  996.         EndM
  997.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  998.         IMPORT_CFM_FUNCTION IsMenuItemIconEnabled
  999.     ENDIF
  1000.  
  1001.  
  1002. ; ——————————————————————————————————————————————————————————————————————————————————————
  1003. ;     • Menu Item Color Tables                                                             
  1004. ;                                                                                           
  1005. ;     Menu color manipulation is considered deprecated with the advent of the Appearance    
  1006. ;     Manager.  Avoid using these routines if possible                                     
  1007. ; ——————————————————————————————————————————————————————————————————————————————————————
  1008. ;
  1009. ; pascal void DeleteMCEntries(short menuID, short menuItem)
  1010. ;
  1011.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1012.         _DeleteMCEntries:    OPWORD    $AA60
  1013.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1014.         IMPORT_CFM_FUNCTION DeleteMCEntries
  1015.     ENDIF
  1016.  
  1017. ;
  1018. ; pascal MCTableHandle GetMCInfo(void )
  1019. ;
  1020.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1021.         _GetMCInfo:    OPWORD    $AA61
  1022.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1023.         IMPORT_CFM_FUNCTION GetMCInfo
  1024.     ENDIF
  1025.  
  1026. ;
  1027. ; pascal void SetMCInfo(MCTableHandle menuCTbl)
  1028. ;
  1029.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1030.         _SetMCInfo:    OPWORD    $AA62
  1031.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1032.         IMPORT_CFM_FUNCTION SetMCInfo
  1033.     ENDIF
  1034.  
  1035. ;
  1036. ; pascal void DisposeMCInfo(MCTableHandle menuCTbl)
  1037. ;
  1038.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1039.         _DisposeMCInfo:    OPWORD    $AA63
  1040.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1041.         IMPORT_CFM_FUNCTION DisposeMCInfo
  1042.     ENDIF
  1043.  
  1044. ;
  1045. ; pascal MCEntryPtr GetMCEntry(short menuID, short menuItem)
  1046. ;
  1047.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1048.         _GetMCEntry:    OPWORD    $AA64
  1049.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1050.         IMPORT_CFM_FUNCTION GetMCEntry
  1051.     ENDIF
  1052.  
  1053. ;
  1054. ; pascal void SetMCEntries(short numEntries, MCTablePtr menuCEntries)
  1055. ;
  1056.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1057.         _SetMCEntries:    OPWORD    $AA65
  1058.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1059.         IMPORT_CFM_FUNCTION SetMCEntries
  1060.     ENDIF
  1061.  
  1062.  
  1063.  
  1064. ; ——————————————————————————————————————————————————————————————————————————————————————
  1065. ;  • Properties     (Mac OS 8.5 and later)                                                    
  1066. ;                                                                                         
  1067. ;  With the following property APIs, you can attach any piece of data you'd like to a    
  1068. ;  menu or menu item. Passing zero for the item number parameter indicates you'd like    
  1069. ;  to attach the data to the menu itself, and not to any specific menu item.            
  1070. ; ——————————————————————————————————————————————————————————————————————————————————————
  1071. ;
  1072. ; pascal OSStatus GetMenuItemProperty(MenuHandle menu, UInt16 item, OSType propertyCreator, OSType propertyTag, UInt32 bufferSize, UInt32 *actualSize, void *propertyBuffer)
  1073. ;
  1074.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1075.         IMPORT_CFM_FUNCTION GetMenuItemProperty
  1076.     ENDIF
  1077.  
  1078. ;
  1079. ; pascal OSStatus GetMenuItemPropertySize(MenuHandle menu, UInt16 item, OSType propertyCreator, OSType propertyTag, UInt32 *size)
  1080. ;
  1081.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1082.         IMPORT_CFM_FUNCTION GetMenuItemPropertySize
  1083.     ENDIF
  1084.  
  1085. ;
  1086. ; pascal OSStatus SetMenuItemProperty(MenuHandle menu, UInt16 item, OSType propertyCreator, OSType propertyTag, UInt32 propertySize, void *propertyData)
  1087. ;
  1088.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1089.         IMPORT_CFM_FUNCTION SetMenuItemProperty
  1090.     ENDIF
  1091.  
  1092. ;
  1093. ; pascal OSStatus RemoveMenuItemProperty(MenuHandle menu, UInt16 item, OSType propertyCreator, OSType propertyTag)
  1094. ;
  1095.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1096.         IMPORT_CFM_FUNCTION RemoveMenuItemProperty
  1097.     ENDIF
  1098.  
  1099.  
  1100.  
  1101. ; ——————————————————————————————————————————————————————————————————————————————————————
  1102. ;     • Contextual Menu routines and constants                                            
  1103. ;     available with Conxtextual Menu extension 1.0 and later                                
  1104. ; ——————————————————————————————————————————————————————————————————————————————————————
  1105. ;  Gestalt Selector for classic 68K apps only. 
  1106. ;  CFM apps should weak link and check the symbols. 
  1107.  
  1108. gestaltContextualMenuAttr        EQU        'cmnu'
  1109. gestaltContextualMenuUnusedBit    EQU        0
  1110. gestaltContextualMenuTrapAvailable EQU    1
  1111. ;  Values indicating what kind of help the application supports 
  1112.  
  1113. kCMHelpItemNoHelp                EQU        0
  1114. kCMHelpItemAppleGuide            EQU        1
  1115. kCMHelpItemOtherHelp            EQU        2
  1116. ;  Values indicating what was chosen from the menu 
  1117.  
  1118. kCMNothingSelected                EQU        0
  1119. kCMMenuItemSelected                EQU        1
  1120. kCMShowHelpSelected                EQU        3
  1121. ;
  1122. ; pascal OSStatus InitContextualMenus(void )
  1123. ;
  1124.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1125.         Macro
  1126.         _InitContextualMenus
  1127.             moveq               #1,D0
  1128.             dc.w                $AA72
  1129.         EndM
  1130.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1131.         IMPORT_CFM_FUNCTION InitContextualMenus
  1132.     ENDIF
  1133.  
  1134. ;
  1135. ; pascal Boolean IsShowContextualMenuClick(const EventRecord *inEvent)
  1136. ;
  1137.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1138.         Macro
  1139.         _IsShowContextualMenuClick
  1140.             moveq               #2,D0
  1141.             dc.w                $AA72
  1142.         EndM
  1143.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1144.         IMPORT_CFM_FUNCTION IsShowContextualMenuClick
  1145.     ENDIF
  1146.  
  1147. ;
  1148. ; pascal OSStatus ContextualMenuSelect(MenuHandle inMenu, Point inGlobalLocation, Boolean inReserved, UInt32 inHelpType, ConstStr255Param inHelpItemString, const AEDesc *inSelection, UInt32 *outUserSelectionType, SInt16 *outMenuID, UInt16 *outMenuItem)
  1149. ;
  1150.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1151.         Macro
  1152.         _ContextualMenuSelect
  1153.             moveq               #3,D0
  1154.             dc.w                $AA72
  1155.         EndM
  1156.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1157.         IMPORT_CFM_FUNCTION ContextualMenuSelect
  1158.     ENDIF
  1159.  
  1160. ;
  1161. ; pascal Boolean ProcessIsContextualMenuClient(ProcessSerialNumber *inPSN)
  1162. ;
  1163.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1164.         Macro
  1165.         _ProcessIsContextualMenuClient
  1166.             moveq               #4,D0
  1167.             dc.w                $AA72
  1168.         EndM
  1169.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1170.         IMPORT_CFM_FUNCTION ProcessIsContextualMenuClient
  1171.     ENDIF
  1172.  
  1173.  
  1174.  
  1175.  
  1176.     IF OLDROUTINENAMES THEN
  1177.     ENDIF    ; OLDROUTINENAMES
  1178.  
  1179.  
  1180.     IF TARGET_OS_WIN32 THEN
  1181.     ENDIF    ; TARGET_OS_WIN32
  1182.     ENDIF ; __MENUS__ 
  1183.  
  1184.